import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: "/login",
    name: "Login",
    component: () => import(/* webpackChunkName: "login" */ '../views/Login/Login.vue')
  },
  {
    path: "/home",
    name: "Home",
    component: () => import(/* webpackChunkName: "home" */ '../views/Home/Home.vue'),
    children: [
      {
        path: "/",
        redirect: "/good"
      },
      {
        path: '/good',
        component: () => import('../components/HomeChild/Good.vue')
      },
      {
        path: '/category',
        component: () => import('../components/HomeChild/Category.vue')
      },
      {
        path: '/brand',
        component: () => import('../components/HomeChild/Brand.vue')
      },
      {
        path: '/attribute',
        component: () => import('../components/HomeChild/Attribute.vue')
      },
      {
        path: '/order',
        component: () => import('../components/HomeChild/Order.vue')
      },
      {
        path: '/topic',
        component: () => import('../components/HomeChild/Topic.vue')
      },
      {
        path: '/statdata',
        component: () => import('../components/HomeChild/Statdata.vue')
      },
    ]
  }
  // {
  //   path: '/',
  //   name: 'Home',
  //   component: Home
  // },
  // {
  //   path: '/about',
  //   name: 'About',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  // }
]

const router = new VueRouter({
  // mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
